package com.tianluo.tianluobookstore.exception;

import com.tianluo.tianluobookstore.enums.CommonCodeEnum;
import com.tianluo.tianluobookstore.enums.UserCodeEnum;

public class BizException extends RuntimeException {

    private String retCode;

    private String retMessage;

    public BizException() {
        super();
    }

    public BizException(UserCodeEnum userCodeEnum) {
        this.retCode = userCodeEnum.getCode();
        this.retMessage = userCodeEnum.getMessage();
    }

    public BizException(CommonCodeEnum commonCodeEnum) {
        this.retCode = commonCodeEnum.getCode();
        this.retMessage = commonCodeEnum.getMessage();
    }

    public BizException(String retCode, String retMessage) {
        this.retCode = retCode;
        this.retMessage = retMessage;
    }

    public String getRetCode() {
        return retCode;
    }

    public String getRetMessage() {
        return retMessage;
    }
}